import request from '@/router/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/mes-alert/strategy/page-query',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

export const getAltStrategyType = () => {
    return request({
        url: '/api/blade-system/dict/dictionary?code=ALT_STRATEGY_TYPE',
        method: 'get',
    });
};

export const getModule = (metricType) => {
    return request({
        url: '/api/mes-alert/metric/module-key-value',
        method: 'get',
        params: {
            metricType
        }
    });
};
export const getMetricByModule = (moduleKey) => {
    return request({
        url: '/api/mes-alert/metric/get-metric-by-module',
        method: 'get',
        params: {
            moduleKey
        }
    });
};
export const getAltRuleContrastMethod = () => {
    return request({
        url: '/api/blade-system/dict/dictionary?code=ALT_RULE_CONTRAST_METHOD',
        method: 'get',
    });
};
export const getRoleList = () => {
    return request({
        url: '/api/blade-system/role/role-user-count',
        method: 'get',
    });
};
export const submit = (data) => {
    return request({
        url: '/api/mes-alert/strategy/submit',
        method: 'post',
        data: data
    });
};
export const getDetail = (id) => {
    return request({
        url: '/api/mes-alert/strategy/detail',
        method: 'get',
        params: {
            id
        }
    });
};
export const remove = (ids) => {
    return request({
        url: '/api/mes-alert/strategy/remove',
        method: 'get',
        params: {
            ids
        }
    });
};
export const enable = (ids) => {
    return request({
        url: '/api/mes-alert/strategy/enable',
        method: 'get',
        params: {
            ids
        }
    });
};
export const disable = (ids) => {
    return request({
        url: '/api/mes-alert/strategy/disable',
        method: 'get',
        params: {
            ids
        }
    });
};
export const getTree = () => {
    return request({
        url: '/api/blade-system/dept/lazy-tree?parentId=0',
        method: 'get'
    });
};
export const getTreeChild = (deptId) => {
    return request({
        url: '/api/blade-system/dept/dept-user-children',
        method: 'get',
        params: {
            deptId
        }
    });
};